#ifndef SYM_H
#define SYM_H
#include <bits/stdc++.h>
enum class SYMS
{
  // 关键字
  CONST,
  VAR,
  BEGIN,
  END,
  IF,
  THEN,
  WHILE,
  DO,
  READ,
  WRITE,
  ELSE,
  PROCEDURE,
  ODD,
  REPEAT,
  UNTIL,
  CALL,
  // 运算符
  EQUAL,        //=
  COMMA,         //,
  SEMICOLON,     //;
  DOT,           //.
  LEFT_BRACKET,  //(
  RIGHT_BRACKET, //)
  COLON,         //:
  LESS,          //<
  GREATER,       //>
  PLUS,          //+
  MINUS,         //-
  LESS_EQUAL,    //<=
  RIGHT_EQUAL,    //>=
  NOT_EQUAL,     //#
  VAR_ASSIGN, //:=
  MULTIPLY,//*
  DIVIDE,// /
  //数字
  NUMBER,
                 // 标识符
  IDENT,
  // 空类型
  NILL,
};
extern SYMS SYM;
class TOKEN {
public:
    std::string word;
    SYMS sym;
    std::string id;
    int num;
    TOKEN();
    TOKEN(SYMS _sym,const std::string& _id,int _num, const std::string& _word);
    static TOKEN* newKey(SYMS _sym,const std::string& word);
    static TOKEN* newID(const std::string& _id,const std::string& word);
    static TOKEN* newNum(int _num,const std::string& word);
    static TOKEN* newOpt(SYMS _sym,const std::string& word);
    friend std::ostream& operator<<(std::ostream& os,const TOKEN& obj);
};

std::string nameSym(SYMS sym);
bool checkOpt(std::string s);
extern std::string ID;
bool setId(std::string s);
bool checkKey(std::string s);
extern int NUM;
bool setNum(std::string s);
std::vector<TOKEN*>* getSYM(std::string &in);
#endif